package wiki.zimo.filter;


import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @auther: 子墨
 * @datetime: 2018/11/8 13:34
 * @describe: 统一编码过滤器
 */
@WebFilter(value = "/*")
public class EncodingFilter implements Filter {

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
//		response.setContentType("text/html;charset=utf-8");

        chain.doFilter(request, response);
    }
}
